#include "system/application.h"
#include "system/applicationsetup.h"

namespace dw {
	namespace system {

//------------------------------------------------------------------------------
// Commands
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
void Application::run(int argc, char** argv)
{
	if (onSetup(argc, argv))
	{
		_isRunning = true;

		while (!mustStop())
		{
			onIdle();
		}

		_isRunning = false;

		onShutdown();
	}
}

//------------------------------------------------------------------------------
void Application::stop()
{
	_mustStop = true;
}

//------------------------------------------------------------------------------
// Construction & destruction
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
Application::Application()
:	_isRunning(false)
,	_mustStop(false)
{
}

//------------------------------------------------------------------------------
Application::~Application()
{
}

	} // namespace system
} // namespace dw

